<?php

//推荐控制器
class Hot extends Controller {

	var $userid;
	
	function Hot()
	{
		parent::Controller();	
		$this->load->model("accounts_model", "am");
		$this->load->model("position_model");
		$this->load->model("site_model", "sm");
		$this->load->model("message_model");
		$this->load->model("comment_model");
		$this->load->model("sitestatis_model", "ssm");
		
		//登陆状态检测
		$this->userid = $this->am->is_logined();
		$this->account = $this->am->get_account();
		//获取用户小站信息
		$this->usersite = $this->sm->get_usersite($this->userid);
	}
	
	//默认首页
	function index()
	{

		//输出公共header
		$pagedata["topmenuid"] = 9;
		$this->autoload_model->output_header($pagedata);
		
		//获取关注数量
		$myfuns = $this->ssm->get_userfuns($this->userid);
		$viewdata["myfuns"] = $myfuns;
		
		//新邮件
		if ($this->userid > 0) {
			$viewdata["mymessages"] = $this->message_model->new_messages($this->userid);
			$viewdata["mynotices"] = $this->message_model->new_notices($this->userid);
			$viewdata["newcomment"] = $this->comment_model->has_newcomment($this->userid);
		}
		
		//获取推荐小站列表
		$sitegirl = $this->sm->position_site('staticgirl', 9);
		$siteboy = $this->sm->position_site('staticboy', 9);
		
		//获取栏位列表
		$posgirl = $this->position_model->list_item(0, 8, 2);
		$posboy = $this->position_model->list_item(0, 8, 1);
//		a($posgirl);
		
		$viewdata["account"] = $this->account;
		$viewdata["usersite"] = $this->usersite;
		$viewdata["sitegirl"] = $sitegirl;
		$viewdata["siteboy"] = $siteboy;
		$viewdata["posgirl"] = $posgirl;
		$viewdata["posboy"] = $posboy;
		$this->load->view(__CLASS__.'/index', $viewdata);
		
		//输出公共footer
		$this->autoload_model->output_footer();
	}
	
}

/* End of file */